package top.i51213.fastaction.view;

import androidx.appcompat.app.AppCompatActivity;

import android.net.Uri;
import android.os.Bundle;
import android.widget.Toast;

import java.util.ArrayList;
import java.util.Collections;

import top.i51213.fastaction.ReceiveActivity;
import top.i51213.fastaction.ReceiveClassName;
import top.i51213.fastaction.uri.MimeType;

public class Open4ShareActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        String action = getIntent().getAction();
        String type = getIntent().getType();
        Uri uri=getIntent().getData();
        if(uri==null) {
            Toast.makeText(this,"未发现任何文件",Toast.LENGTH_SHORT).show();
            return;
        }
        ArrayList<Uri> uris=new ArrayList<>(Collections.singletonList(uri));
        ReceiveActivity.startThis(this,ReceiveClassName.AnyShare,uris, MimeType.Others.Any.get());
        finish();
    }

}